#include "../src/ProjectConfig.hpp"
#include <iostream>

int main()
{
  if(std::filesystem::exists("/tmp/ProjectConfig_Test"))
    std::filesystem::remove_all("/tmp/ProjectConfig_Test");
  std::filesystem::create_directory("/tmp/ProjectConfig_Test");
  ProjectConfig projectConfig("/tmp/ProjectConfig_Test");
  std::cout<<"Create New Project : name AA"<<std::endl;
  projectConfig.CreateProject("AA","AA","is a test element");
  auto PrintfStringList=[](const std::vector<std::string> & list){
    for(const auto & i : list)
        std::cout<<i<<",";
    std::cout<<std::endl;
  };
  std::cout<<"Get Project List"<<std::endl;
  PrintfStringList(projectConfig.GetProjectList());
  std::cout<<"Get Project Path : "<<projectConfig.GetProjectPath("AA")<<std::endl;
  std::cout<<"Create New Task : TB"<<std::endl;
  projectConfig.CreateTask("AA","TB","TB");
  std::cout<<"Get Task List"<<std::endl;
  PrintfStringList(projectConfig.GetTaskList("AA"));
  std::cout<<"Get Task Path : "<<projectConfig.GetTaskPath("AA","TB").string()<<std::endl;
  std::cout<<"Append some video"<<std::endl;
  projectConfig.CreateOriginVideo("AA","TB","C1","C1.mkv");
  projectConfig.CreateOriginVideo("AA","TB","C2","C2.mkv");
  PrintfStringList(projectConfig.GetTaskOriginVideoList("AA","TB"));
  std::cout<<"Get C1 Video Path: "<<projectConfig.GetTaskOriginVideoPath("AA","TB","C1").string()<<std::endl;

  projectConfig.SaveData();
}
